import { createRouter, createWebHistory, RouteRecordRaw } from "vue-router";
// import TheLogin from "../views/TheLogin.vue";
// import TheChart from "../views/TheChart.vue";
// import LoginLn from "../components/LoginLn.vue";
// import RegisteredS from "../components/RegisteredS.vue";
// import MainPage from "../views/MainPage.vue";
// import TenantsList from "../components/TenantsList.vue";
// import TenantChanges from "../components/TenantChanges.vue";
const routes: Array<RouteRecordRaw> = [
  {
    path: "/login",
    name: "login",
    // component: () => import('../views/login/index.vue')
    // component: TheLogin,
    component: () => import("../views/TheLogin.vue"),
    children: [
      {
        path: "log",
        name: "log",
        component: () => import("../components/LoginLn.vue"),
        // component: LoginLn,
      },
      {
        path: "registered",
        name: "registered",
        // component: RegisteredS,
        component: () => import("../components/RegisteredS.vue"),
      },
    ],
  },
  {
    path: "/",
    redirect: "/login/log",
  },
  {
    path: "/page",
    name: "page",
    // component: MainPage,
    component: () => import("../views/MainPage.vue"),
    children: [
      {
        path: "chart",
        name: "chart",
        component: () => import("../views/TheChart.vue"),
        // component: TheChart,
        meta: {
          tiete: "数据展示",
          color: "TrendCharts",
        },
      },
      {
        path: "rights",
        name: "rights",
        component: () => import("../views/RightsManagement.vue"),
        // component: TheChart,
        meta: {
          tiete: "权限管理",
          color: "Lock",
        },
      },
      {
        path: "cost",
        name: "cost",
        component: () => import("../views/PayCost.vue"),
        // component: TenantsList,
        meta: {
          tiete: "缴费管理",
          color: "Grid",
        },
      },
      {
        path: "mation",
        name: "mation",
        component: () => import("../views/InfoRmation.vue"),
        meta: {
          tiete: "住户信息",
          color: "List",
        },
        children: [
          {
            path: "tenant",
            name: "tenant",
            component: () => import("../components/TenantsList.vue"),
            // component: TenantsList,
            meta: {
              tiete: "住户信息列表",
            },
          },
          {
            path: "changes",
            name: "changes",
            component: () => import("../components/TenantChanges.vue"),
            // component: TenantChanges,
            meta: {
              tiete: "住户信息修改",
            },
          },
        ],
      },
    ],
  },
];

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes,
});

export default router;
